;;*******************************************************************************
;;MOTOROLA INTERNAL USE ONLY
;;COPYRIGHT 1999 MOTOROLA, INC.
;;*******************************************************************************
;;*******************************************************************************
;; 
;; File         	: MotoTLS_scanHierarchy(index is :sch -> SCan Hierarchy)
;; 
;; Cadence			: 4.4
;; 
;; Owner    		: C.Pareilleux (r40054@email.sps.mot.com)
;; 
;; Creation      	: Fri Dec  3 11:21:10 MET 1999
;; 
;; Description   	: Replace all the instances of a cellview by an other instance in all the cells
;;							of a selected library . 
;;							Parameters of the initial instances are copied in the new instances 
;; 
;; 
;;*******************************************************************************





;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;	Procedure	: MotoTLS_schScanHierarchy
;;
;;	arguments	: 	cv 			= cellView Id on which ruh the scanning.
;;						scanView		=	viewName on which run the scanning.
;;						refLiblist 	= list of the libraries of which the components can be extracted.
;;						stopLiblist = list of the libraries on which stop the descend in the hierarchy.
;;						blockList 	= output database. Must be set to nil when start to run the procedure
;;
;; purpose 		: extract all cell that have not purpose=pin
;;							check is the instance is a primitive (block or cell)
;;							store each cell in a database only if cell comes from one of the reference library
;;							if there is at least one instnace in cv, then store cv as a block.
;; 						go down into the hierarchy only in the block of cv (don't go down into the primitive cell)
;;    					(don't extract subcells of the primitive useful only for the simulation)
;;
;;							return a database named blockList as following
;;							blockList=list of dbBlock
;;								dbBlock
;;									- identity 	: strcat(cellName libName), to allow easy recognition
;;									- cv  		: id of the cellview
;;									- instList	: list of dbInst present in the block
;;									  					dbInst :
;;									  						- identity 	: strcat(cellName libName), to allow easy recognition
;;															- type		: block / cell
;;															- cv			: id of the instance
;;	
;;			
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
procedure(MotoTLS_extractPathToInstName(cv instName scanView stopLibList )
	let((excludePurpose elt currentInstName cv_a)
	 	
		excludePurpose=list("pin")
		
		;; define structure for the dataBase
		
		foreach(elt cv~>instances 
			if( !member(elt~>purpose excludePurpose)  then 
				currentInstName = strcat( instName elt~>name)
				
				
				if( !member(elt~>libName stopLibList) then				
					;;__________________________________________________________________________________________
					;; if instance is a block then going down in the hierarchy with "MotoTLS_echExtractCellInHierarchy"
					;;__________________________________________________________________________________________
					if( dbGetAnyInstSwitchMaster(elt scanView) then
						cv_a = dbOpenCellViewByType(ddGetObj(elt~>libName) elt~>cellName scanView nil "a")
						MotoTLS_extractPathToInstName(cv_a currentInstName scanView stopLibList)
						dbSave(cv_a)
						dbClose(cv_a) 
					)
				)

			);end if
		);end foreach
		
	);end let
);end procedure
		

;MotoTLS_extractPathToInstName(geGetEditCellView() "" "layout" list("smos5ap" "dsesm5ap"))



